package com.example.demo.controller;

import com.example.demo.entity.SjShop;
import com.example.demo.entity.VO.shopvo;
import com.example.demo.entity.classify;
import com.example.demo.entity.lb;
import com.example.demo.service.impl.SjShopServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (SjShop)表控制层
 *
 * @author makejava
 * @since 2021-07-02 22:27:45
 */
@RestController
public class SjShopController {
    /**
     * 服务对象
     */
    @Resource
    private SjShopServiceImpl sjShopService;

    /**
     * 通过主键查询单条数据
     *
     * @return 单条数据
     */
    @RequestMapping("selectOne")
    public List<SjShop> ChaXun() {
        return sjShopService.ChaXun();
    }

    @PostMapping("queryId")
    public  SjShop queryId(@RequestBody shopvo shopvo){
        return  sjShopService.queryId(shopvo.getId());
    }
    //商店 分类
    @PostMapping("classify")
    public List<classify> classify(@RequestBody shopvo shopvo){

        return  sjShopService.classify(shopvo.getId());
    }
    //推荐店铺 按 商店评分降序
    @GetMapping("recommended")
    public  List<classify> recommended(){
        return  sjShopService.recommended();
    }
    //商店详情界面  的轮播图片
    @PostMapping("lb")
    public List<lb>  lb(@RequestBody shopvo shopvo){
        
        return  sjShopService.lb(shopvo.getId());
    }
}
